﻿/**
 * Scene_Credits
 * 
 * @version 2012.01.18
 * @author  Bruno Miguel de Oliveira Tamer <bmotamer@gmail.com>
 */

#region XNA Libraries

using Microsoft.Xna.Framework.Input;

#endregion

#region SDK Libraries

using main.sdk.audio;
using main.sdk.display;
using main.sdk.display.object2d;
using main.sdk.input;
using main.sdk.scene;

#endregion

namespace main.src.scene
{

    public sealed class Scene_Credits : Scene_Base
    {

        public Sprite Title = new Sprite("RSC/Picture/Title");
        public Label  Label = new Label("Seven Game\nAlexandre Alencar\nBruno Miguel\nMarcelo Z. Granja\n\n\nNonSevenGame :D\nRenan Hangai");
        public byte   Step  = 0;

        public override void Start()
        {
            Title.Center();
            Title.Alpha = 0;
            Label.X = (Program.Width - Label.Width) / 2;
            Label.Y = Program.Height;
            Label.Alpha = 0;
        }

        public override void Update()
        {
            if (Input.AnyDown())
                Step = 2;
            switch (Step)
            {
                case 0:
                    Title.Alpha += 5;
                    Label.Alpha += 5;
                    if (Title.Alpha == 255)
                        Step = 1;
                    break;
                case 1:
                    if (Title.Position.Y > 0)
                        Title.Position.Y--;
                    if (Label.Position.Y > Title.Height)
                        Label.Position.Y--;
                    break;
                case 2:
                    Title.Alpha -= 5;
                    Label.Alpha -= 5;
                    if (Title.Alpha == 0)
                        Scene.Set(new Scene_Title());
                    break;
            }
        }

        public override void Terminate()
        {
            Title.Dispose();
            Label.Dispose();
        }

    }

}